<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('teamsetting',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('teamsetting');
	$return['item']['jy_robshop']=$this->plugin_exists('jy_robshop')?1:0;
	$return['item']['footernav'] = !empty($return['item']['footernav']) ? $return['item']['footernav'] : $footernav;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基础设置',
				'list'=>array(
					array('type'=>'switch','title'=>'开启团收益','name'=>'isopen'),
					array('type'=>'radio','title'=>'成为默认等级条件','name'=>'become','options'=>'become'),
					array('type'=>'unitstring','unit'=>'元','title'=>'自购订单总金额','name'=>'buyallfee','show'=>array('become'=>4)),
					array('type'=>'choose_many','title'=>'购买指定商品升级','name'=>'goods_ids','action'=>'jy_weishop/goods.get_goods/many/','choose_title'=>'选择参与的商品','show'=>array('become'=>5)),
					array('type'=>'checkbox','title'=>'团队升级要求','name'=>'level_up_types','options'=>'leveltype','help'=>''),
					array('type'=>'unitstring','unit'=>'元','name'=>'vip_fee','title'=>'首次参与抢购满N元','help'=>'首次参与抢购多少元，才能享受会员价格购买；'),
					array('type'=>'unitstring','unit'=>'次','name'=>'kao_num','title'=>'所有团长等级本月考核购物次数','help'=>'填写数字或小数；'),
					array('type'=>'checkbox','title'=>'不满足本月考核,不享受的佣金','name'=>'kao_feetype','options'=>'kao_feetype','help'=>'团长不满足月考核购物次数，不享受佣金科目设置'),
					array('type'=>'unitstring','unit'=>'%','name'=>'store_per','title'=>'加权分红','help'=>'填写数字或小数；'),
					array('type'=>'switch','title'=>'是否需要审核','name'=>'isshenhe'),
					array('type'=>'switch','title'=>'是否需要完善资料','name'=>'isinfo'),
					array('type'=>'switch','title'=>'关闭转账功能？','name'=>'isno_zhuan','help'=>''),
					array('type'=>'string','title'=>'团队分享二维码说明','name'=>'share_help'),
					array('type'=>'string','title'=>'团队分享标题','name'=>'teamshare_title'),
					array('type'=>'string','title'=>'团队分享描述','name'=>'teamshare_desc'),
					array('type'=>'richtext','title'=>'团队须知','name'=>'team_xieyi'),
				)
			),
			array(
				'title'=>'结算设置',
				'list'=>array(
					array('type'=>'switch','title'=>'下单即可结算','name'=>'is_jiesuan','help'=>'不用等完成订单，就可以结算！'),
					array('type'=>'checkbox','title'=>'支持的提现方式','name'=>'withdrawtype','options'=>'withdraw'),
					array('type'=>'string','title'=>'结算额度（元）','name'=>'balance_fee'),
					array('type'=>'string','title'=>'分红打款手续费（%）','name'=>'balance_per'),
					array('type'=>'string','title'=>'结算天数','name'=>'balance_day','help'=>'当订单完成后的n天后，订单才能申请结算,设置0或空，订单完成就可以结算'),
				),
			),
		)
	);
	$return['team_tiaojians']=$this->team_tiaojians;
	$return['leveltype']=$this->level_up_types;
	$return['kao_feetype']=$this->kao_feetype;
	$return['become']=array('0'=>'无条件','1'=>'后台指定','2'=>'提交申请','3'=>'参与抢购','4'=>'自购订单总金额','5'=>'指定购买商品');
	$return['level']=$this->level_types;
	$return['withdraw']=$this->pay_types;
	$return['htmls']=$htmls;
	exi($return);
}


